package DataStuctures.Stack;

public class IsValid2 {

    private ArrayStack<Character> stack = new ArrayStack<>();

    public static void main(String[] args) {





    }

    public boolean isvalue(String str){



        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            if (c == '(' || c == '{' || c == '[') {
                stack.push(c);
            }else if(c == ')'){
                stack.pop();

            }else if(c == '}'){
                stack.pop();
            }else {
                stack.pop();
            }



        }


        return false;

    }

}
